home *** CD-ROM | disk | FTP | other *** search
- ' ===========================================================================
- ' ImageDTInfo by © 1999-2000 Dámaso D. Estévez
- ' Fido : 2:348/613.44
- ' Inet : amidde@arrakis.es
- ' WWW : http://www.arrakis.es/~amidde/
- '
- ' ImageDTInfo.bas (main code/código principal)
- '
- ' For to compile this, use the compiler prefs file "HBCImageDTInfo.opts"
- ' (the `Tokens.t' file IS NEEDED for to compile this code...
- ' except if you include the `Tokens.bas' code in this code at start).
- ' -----------
- ' Para compilar este programa utilice el fichero de prefencias
- ' del compilador "HBCImageDTInfo.opts" (el fichero `Tokens.t'
- ' ES NECESARIO para poder compilar el programa...
- ' salvo si incluye el código de `Tokens.bas' al inicio de este código :D).
- ' ===========================================================================
- ' Created for use with FWCalendar Arexx script written by Ron Goertz
- ' and as a little coding exercise with (Hisoft|Maxon) Basic 2.
- ' You can re-use freely this code in your own works.
- ' ------------
- ' Creado para usar con el guión ARexx FWCalendar de Ron Goertz
- ' y como un pequeño ejercicio de programación con (Hisoft|Maxon) Basic 2.
- ' Puede reutilizar libremente este código en sus producciones.
- ' ===========================================================================
-
- ' ------------- Opening libraries -------------
- ' -- (OS datatypes system appears from v39) ---
-
- ' ---------- Apertura de bibliotecas ----------
- ' --- (el sistema de tipos de datos aparece ---
- ' --- a partir de la versión 39 del S.O. ;) ---
- ' ---------------------------------------------
-
- ' CacheClearE()
- LIBRARY OPEN "exec.library",39&
-
- ' OpenCatalogA(), CloseCatalog()
- LIBRARY OPEN "locale.library",39&
-
- ' ----- Locale support ------
- ' ---- Prestación local -----
- ' ---------------------------
- DIM SHARED localeInfo&(2)
- localeInfo&(0) = LIBRARY("locale.library")
- IF localeInfo&(0) <> NULL& THEN
- localeInfo&(1) = OpenCatalogA&(NULL&, SADD("ImageDTInfo.catalog" + CHR$(0)), NULL&)
- END IF
-
- REM $include BH:BLib/GetCString.bas
- REM $include Locale/ImageDTInfo_Locale.bc
- REM $include Locale/ImageDTInfo_Locale.bas
-
- FUNCTION CadLc$(BYVAL id&)
- CadLc$ = PEEK$(GetCString&(VARPTR(localeInfo&(0)),id&))
- END FUNCTION
-
- ' - Loading my modules with functions/subroutines -
- ' - Cargando mis módulos con funciones/subrutinas -
- ' -------------------------------------------------
- REM $include AuxRoutines/GetArg.bas
- REM $include AuxRoutines/InfoImgFile.bas
-
- ' --------- Shared vars for error handling --------
- ' -- Variables compartidas de gestión de errores --
- ' -------------------------------------------------
- en& = 0&
- em$ = ""
-
- ' ---- Calling the main routine ----
- ' - Llamando a la rutina principal -
- ' ----------------------------------
- CALL main(COMMAND$)
-
- IF LIBRARY("locale.library") <> NULL& THEN
- CloseCatalog localeInfo&(1)
- END IF
-
- LIBRARY CLOSE "exec.library"
-
- END
-
- ' =====================================================================
- ' "Main"subroutine / Sub-rutina "Main"
- ' =====================================================================
-
- SUB main(cad$) SHARED en&,em$
- LOCAL tmp$,version$
-
- ' -- Variables initialization ---
- ' - Inicialización de variables -
- '--------------------------------
-
- ' Copyright string / Cadena de autoría
- version$ ="$VER: ImageDTInfo 1.51 (18.8.00) © Dámaso D. Estévez <amidde@arrakis.es>"
-
- ' ---- Asking the first argument ----
- ' - Solicitando el primer argumento -
- ' -----------------------------------
- cad$=getarg$(cad$,1)
-
- ' - There is the argument? -
- ' ---- ¿Hay argumento? -----
- ' --------------------------
- IF cad$<>"" THEN
-
- tmp$=InfoImgFile$(cad$)
-
- IF tmp$<>"" AND en&=0 AND em$="" THEN
-
- PRINT tmp$
-
- ELSE
-
- ' --------- If there was some error, -----------
- ' ------ prints the error code (& message) -----
-
- ' - Si se ha producido algún error, se imprime -
- ' ------ el código (y el mensaje de error) -----
- ' ----------------------------------------------
-
- PRINT CadLc$(ERROR_TITLE&);
- IF en&<>0 THEN
- PRINT " - ";CadLc$(ERROR_CODE_INFO&);": ";en&
- ELSE
- PRINT
- END IF
-
- PRINT CadLc$(ERROR_ARG_INFO&)": `";cad$;"'"
-
- IF em$<>"" THEN
- PRINT em$
- END IF
-
- END IF
-
- ELSE
-
- ' -------- The user didn't include a filename as argument ----------
- ' - El usuario no ha incluído un nombre de fichero como argumento --
- ' ------------------------------------------------------------------
- PRINT
-
- PRINT RIGHT$(version$,LEN(version$)-6)
- PRINT
- PRINT CadLc$(ERROR_ONLY_ONE_ARG&)
- PRINT
-
- END IF
-
- END SUB
-